
//
//  ILCarListNoPicTableViewCell.m
//  ILife
//
//  Created by lanou on 15/10/31.
//  Copyright © 2015年 ILife. All rights reserved.
//

#import "ILCarListNoPicTableViewCell.h"

@implementation ILCarListNoPicTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        CGFloat height = SCREEN_HEIGHT / 4;
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 5, SCREEN_WIDTH - 20, 20)];
        
        _introLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 25, SCREEN_WIDTH - 20, SCREEN_HEIGHT / 12)];
        
        _originLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, height / 3 + 30, 60, 10)];
        _originLabel.textAlignment = NSTextAlignmentLeft;
        _originLabel.font = [UIFont systemFontOfSize:12];
        
        _timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(SCREEN_WIDTH - 70, height / 3 + 30, 60, 10)];
        _timeLabel.font = [UIFont systemFontOfSize:12];
        _timeLabel.textAlignment = NSTextAlignmentRight;
        
        _readCountLabel = [[UILabel alloc] initWithFrame:CGRectMake(70, height / 3 + 30, 80, 10)];
        _readCountLabel.textAlignment = NSTextAlignmentLeft;
        _readCountLabel.font = [UIFont systemFontOfSize:12];
        
        [self.contentView addSubview:_titleLabel];
        [self.contentView addSubview:_introLabel];
        [self.contentView addSubview:_originLabel];
        [self.contentView addSubview:_timeLabel];
        [self.contentView addSubview:_readCountLabel];
    }
    return self;
}

- (void)setListModel:(ILCarListModel *)listModel {
    _titleLabel.text = listModel.title;
    _titleLabel.textColor = [UIColor grayColor];
    
    _introLabel.font = [UIFont systemFontOfSize:13];
    _introLabel.numberOfLines = 0;
    _introLabel.text = listModel.excerpt;
    _introLabel.textColor = [UIColor grayColor];
    
    _originLabel.text = listModel.origin;
    _originLabel.textAlignment = NSTextAlignmentLeft;
    _originLabel.font = [UIFont systemFontOfSize:12];
    _originLabel.textColor = [UIColor grayColor];
    
    _timeLabel.text = listModel.publishTime;
    _timeLabel.textAlignment = NSTextAlignmentRight;
    _timeLabel.font = [UIFont systemFontOfSize:12];
    _timeLabel.textColor = [UIColor grayColor];
    
    _readCountLabel.text = [@"阅读:"stringByAppendingString:listModel.readCount];
    _readCountLabel.textAlignment = NSTextAlignmentLeft;
    _readCountLabel.font = [UIFont systemFontOfSize:12];
    _readCountLabel.textColor = [UIColor grayColor];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
